package org.boot.ssm.wxshop.mapper;

import org.apache.ibatis.annotations.Param;
import org.boot.ssm.wxshop.common.BaseMapper;
import org.boot.ssm.wxshop.domain.OrderInfo;
import org.boot.ssm.wxshop.domain.OrderInfoDetail;

import java.util.List;

public interface OrderInfoMapper extends BaseMapper<OrderInfo> {

    /**
     * 根据条件分页查询
     * @param orderInfo
     * @param firstTime
     * @param lastTime
     * @return
     */
    public List<OrderInfo> selectOrderInfoForPage(@Param("orderInfo") OrderInfo orderInfo, @Param("firstTime") String firstTime, @Param("lastTime")String lastTime);

    /**
     * 根据用户，订单状态查询所有订单及详情
     * @param id
     * @return
     */
    public List<OrderInfo> selectOrderInfoAndDetil(@Param("id")Integer id,@Param("state")Integer state);

    /**
     * 根据订单号及用户ID查询单个订单
     * @param id
     * @param userId
     * @return
     */
    public OrderInfo selectOneOrderByIdAndUserId(@Param("id")String id,@Param("userId")Integer userId);



}